﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="HotelList.aspx.vb" Inherits="Hotels.HotelList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="ID" DataSourceID="SqlDataSource1" Width="544px">
    <Columns>
        <asp:HyperLinkField DataNavigateUrlFields="HotelUrl" 
            DataNavigateUrlFormatString="{0}" DataTextField="Hotel_Name" 
            HeaderText="Hotel Name" />
        <asp:HyperLinkField DataNavigateUrlFields="Location" 
            DataNavigateUrlFormatString="http://maps.google.co.uk/maps?q={0}" 
            DataTextField="Location" HeaderText="Location" />
        <asp:BoundField DataField="Description" HeaderText="Description" 
            SortExpression="Description" />
        <asp:ImageField DataImageUrlField="Picture" HeaderText="Picture">
            <ControlStyle CssClass="HotelImage" />
        </asp:ImageField>
        <asp:HyperLinkField DataNavigateUrlFields="ID" 
            DataNavigateUrlFormatString="HotelMaster.aspx?ID={0}" DataTextField="ID" 
            HeaderText="MoreDetail" Text="Detail"></asp:HyperLinkField>
        <asp:TemplateField HeaderText="stars">
        <ItemTemplate><h1><%# getStars(Eval("Stars"))%></h1></ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    SelectCommand="SELECT * FROM [Hotels]"></asp:SqlDataSource>
</asp:Content>
